package com.qing.expert.modules.admin.controller;

import com.qing.expert.common.response.R;
import com.qing.expert.modules.admin.service.AdminExportService;
import com.qing.expert.modules.admin.vo.request.ExportRequest;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.qing.expert.common.annotation.OperationLog;

@Slf4j
@RestController
@RequestMapping("/api/admin/export")
public class AdminExportController {

    @Resource
    private AdminExportService adminExportService;

    /**
     * 导出订单数据
     */
    @OperationLog(action = "export_orders", detail = "导出订单数据")
    @PostMapping("/orders")
    public void exportOrders(
            @Validated @RequestBody ExportRequest request,
            HttpServletResponse response) {
        adminExportService.exportOrders(request, response);
    }
}